#include "head.h"

int recv_order(int net_fd, order_t* order_s){
    int err = 0;
    err = recv(net_fd, &order_s->order, sizeof(int), MSG_NOSIGNAL);
    ERROR_CHECK(err, -1, "recv");
    if(err == 0)return -1;

    err = recv(net_fd, &order_s->kv_num, sizeof(int), MSG_NOSIGNAL);
    ERROR_CHECK(err, -1, "recv");
    if(err == 0)return -1;

    err = recv(net_fd, &order_s->buf, sizeof(order_s->buf), MSG_NOSIGNAL);
    ERROR_CHECK(err, -1, "recv");
    if(err == 0)return -1;

    printf("order_s.order: %d\n",order_s->order);
    printf("order_s.buf:%s\n", order_s->buf);

    return 0;
} 
